home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / Aidan's Class Libraries / Source / Layout Classes / GrowLayout.cpp < prev    next >
Encoding:
Text File  |  1997-05-18  |  897 b   |  40 lines  |  [TEXT/CWIE]

  1. //Copyright (c) 1997 Aidan Cully
  2. //All rights reserved
  3.  
  4. #include "CLGrowLayout.h"
  5. #include "CLGrowBox.h"
  6.  
  7. TGrowLayout::TGrowLayout( TLayoutBranch *super, TLayoutLeaf *child ):
  8.     TLayoutBranch( super )
  9. {
  10.     mRealChild= child;
  11.     mGrowBox= 0;
  12. }
  13.  
  14. void TGrowLayout::BuildChildren()
  15. {
  16.     Boolean binds[4];
  17.     mGrowBox= new TGrowBox( this );
  18.     mGrowBox->Init();
  19.     binds[0]= false;
  20.     binds[1]= false;
  21.     binds[2]= true;
  22.     binds[3]= true;
  23.     Rect chRect;
  24.     ::SetRect( &chRect, mContentRect.right-15, mContentRect.bottom-15, mContentRect.right,
  25.      mContentRect.bottom );
  26.     AddChild( mGrowBox, chRect, binds );
  27.     binds[0]= true;
  28.     binds[1]= true;
  29.     mRealChild->SetParent( this );
  30.     AddChild( mRealChild, mContentRect, binds );
  31.     mActiveChild= mRealChild;
  32. }
  33.  
  34. Boolean TGrowLayout::MakeActive( Boolean active )
  35. {
  36.     Boolean retVal= TLayoutBranch::MakeActive( active );
  37.     if( retVal )
  38.         mGrowBox->MakeActive( active );
  39.     return( retVal );
  40. }